package com.jzo2o.customer.controller.agency;

import com.jzo2o.common.utils.UserContext;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description AgencyCertificationAuditController
 * @Author jzh
 * @Date 2025-08-06  17:12
 */

@Slf4j
@RestController("agencyAgencyCertificationAuditController")
@RequestMapping("/agency/agency-certification-audit")
@Api(tags = "机构端 - 机构认证审核相关接口")
public class AgencyCertificationAuditController {

    @Resource
    private IAgencyCertificationAuditService agencyCertificationAuditService;

    @ApiOperation("机构提交认证审核申请")
    @PostMapping
    public void auditSubmit(@RequestBody AgencyCertificationAuditAddReqDTO agencyCertificationAuditAddReqDTO){
        agencyCertificationAuditAddReqDTO.setServeProviderId(UserContext.getCurrentUser().getId());
        agencyCertificationAuditService.auditSubmit(agencyCertificationAuditAddReqDTO);
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO rejectReason(){
        return agencyCertificationAuditService.rejectReason();
    }

}
